<%-- 
    Document   : login
    Created on : 23 лип 2012, 21:12:23
    Author     : Volodymyr Lavrynovych <volodya.lavrynovych@gmail.com>
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="mg" tagdir="/WEB-INF/tags"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
        <title>Log In</title>
        <script>
            $(document).ready(function(){
                new SingleStepForm({
                    id: 'log-in',
                    title: 'Login'
                }).add(new InputControl({
                    id: 'login',
                    placeholder: 'Login',
                    title: 'Login',
                    rules: {
                        required: true,
                        messages: {
                            required: "Please enter a login"
                        }
                    }
                })).add(new InputControl({
                    id: 'password',
                    type: 'password',
                    placeholder: 'Password', 
                    title: 'Password',
                    rules: {
                        required: true,
                        messages: {
                            required: "Please provide a password"
                        }
                    }
                })).addButton(new ButtonElement({
                    onclick: function(){
                        login({
                            login: $('#login'),
                            password: $('#password'), 
                            url: '<mg:baseurl/>',
                            doReditect: true
                        })
                    },
                    id: 'submit',
                    title: 'Login',
                    primary: true
                })).initValidation();
            });
        </script>
    </head>
    <body>
    </body>
</html>
